map filter and reduce array